﻿using System;
using XStudio.XCRF.Data.Enums;

namespace XStudio.XCRF.Data.Business.Permissions
{
    /// <summary>
    /// 表示禁止指定类型的用户操作
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
    public class DenyMemberTypeAttribute : BasePermissionAttribute
    {
        /// <summary>
        /// 表示禁止指定类型的用户操作
        /// </summary>
        /// <param name="types">禁止操作的用户类型，可以采用按位或表示多种</param>
        public DenyMemberTypeAttribute(MemberTypes types)
        {
            _DeniedTypes = types;
        }

        /// <summary>
        /// 被禁止的用户类型
        /// </summary>
        private MemberTypes _DeniedTypes;
        /// <summary>
        /// 获取被禁止的用户类型
        /// </summary>
        public MemberTypes DeniedTypes { get { return _DeniedTypes; } }
    }
}
